home *** CD-ROM | disk | FTP | other *** search
- #include "global.h"
- #include "mbuf.h"
- #include "kiss.h"
- #include "ax25.h"
- #include "trace.h"
-
- void
- ki_dump(fp,bpp,check)
- FILE *fp;
- struct mbuf **bpp;
- int check;
- {
- char type;
- char val;
-
- fprintf(fp,"KISS: ");
- type = PULLCHAR(bpp);
- if((type & 0x0f) == KISS_DATA){
- fprintf(fp,"Port %d Data\n", type >> 4);
- ax25_dump(fp,bpp,check);
- return;
- }
- if(type == KISS_RETURN){
- fprintf(fp,"RETURN\n");
- return;
- } else {
- fprintf(fp,"Port %d ", type >> 4);
- }
- val = PULLCHAR(bpp);
- switch(type & 0x0f){
- case KISS_TXD:
- tprintf("TX Delay: %lu ms\n",uchar(val) * 10L);
- break;
- case KISS_P:
- tprintf("Persistence: %u/256\n",uchar(val) + 1);
- break;
- case KISS_ST:
- tprintf("Slot time: %lu ms\n",uchar(val) * 10L);
- break;
- case KISS_TXT:
- tprintf("TX Tail time: %lu ms\n",uchar(val) * 10L);
- break;
- case KISS_FD:
- tprintf("Duplex: %s\n",uchar(val) == 0 ? "Half" : "Full");
- break;
- case KISS_HW:
- tprintf("Hardware %u\n",uchar(val));
- break;
- default:
- fprintf(fp,"code %u arg %u\n",uchar(type),uchar(val));
- break;
- }
- }
-
- int
- ki_forus(iface,bp)
- struct iface *iface;
- struct mbuf *bp;
- {
- struct mbuf *bpp;
- int i;
-
- if((bp->data[0] & 0x0f) != KISS_DATA)
- return 0;
- dup_p(&bpp,bp,1,AXALEN);
- i = ax_forus(iface,bpp);
- free_p(bpp);
- return i;
- }
-